package ess.control;

public class ElevatorStateClosing extends ElevatorState {

	public ElevatorStateClosing(ElevatorProxy proxy) {
		super(proxy, STATE_CLOSING);
	}

	public void processState() {
		proxy.close();
	}

	public ElevatorState handleCommand(Command c) {
		if(c.equals(Command.COMMAND_DOOR_STOP))
		{
			return proxy.getState(STATE_CLOSED);
		}
		else if(c.equals(Command.COMMAND_DOOR_OPEN))
		{
			return proxy.getState(STATE_OPENING);
		}
		return null;
	}

}
